<template>
  <div>
    <div class="mui-numbox" data-numbox-min="1">
      <button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
      <input id="test" class="mui-input-numbox" type="number" :value="initcount"  @change="countChanged" ref="numbo" readonly/>
      <button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
    </div>
  </div>
</template>
<script>
import mui from "../../lib/mui/js/mui.min.js";
export default {
  mounted() {
    mui(".mui-numbox").numbox();
    // console.log(this.initcount);

    
  },
  methods: {
    countChanged() {
      console.log(this.$refs.numbo.value);
      this.$store.commit('getgoods',{id:this.goodsid,nobuer:this.$refs.numbo.value})
      
    }
  },
  props: ["initcount","goodsid"]
};
</script>
<style lang="less">
.mui-numbox {
  width: 120px;
}
</style>
